var threeSum = function(nums) {
    const mapObj = new Map()
    for(let i=0;i<nums.length;i++){
        let otherNums = nums.slice(0,i).concat(nums.slice(i + 1,nums.length))
        for(let j=0;j<otherNums.length;j++){
            mapObj.set(nums[i]+otherNums[j],[nums[i],otherNums[j]])
        }
    }
    console.log(mapObj);
};
threeSum([-1,0,1,2,-1,-4])